package app.mvp.base_mvp;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.Log;

/**
 * Created by 刘智强 on 2017/4/11.
 */

public abstract class BasePresenter<M, V> {
    public M model;
    public V view;

    private Context context;
    public BaseModel baseModel;
    public BaseView baseView;

    public boolean isGetDataFromCache = false;//是否从缓存获取数据，默认不从缓存数据

    public void setVM(M m, V v) {
        Log.e("TAG", m.getClass().getName());
        Log.e("TAG", v.getClass().getName());
        this.model = m;
        this.view = v;
    }

    public void setContext(Context context) {
        this.context = context;
    }

    public void setBaseModel(BaseModel baseModel) {
        this.baseModel = baseModel;
    }

    public void setBaseView(BaseView baseView) {
        this.baseView = baseView;
    }

    public void setGetDataFromCache(boolean getDataFromCache) {
        isGetDataFromCache = getDataFromCache;
    }

    public abstract void getData(Context context, String... parameters);
}
